    parser.add_option("-f", "--force", dest="force", action="store_true",
                      help="Force transfer even if dst does not exist. \
                      Default: False", default=False)
    parser.add_option("-d", "--dryrun", dest="dryrun", action="store_true",
                      help="Dry run (do not alter destination file). \
                      Default: False", default=False)
    parser.add_option("-q", "--quiet", dest="quiet", action="store_true",
                      help="Quiet. Do not display progress. \
                      Default: False", default=False)
    parser.add_option("--devsize", dest="devsize", action="store", type="int",
                      help="*INTERNAL USE ONLY* Specify dev/file size. \
                      Do NOT use it directly", default=False)
    (options, args) = parser.parse_args()

    check_available_libs()

    # Basic sanity check 参数健全性
    if len(args) < 2:
        parser.print_help()
        print __doc__
        sys.exit(1)

    # Check if right side is local or remote
    local = False
    if args[1] == "localhost":
        local = True
    if local and len(args) < 3:
        parser.print_help()
        print __doc__
        sys.exit(1)

    # Select hash function
    hashfunc = get_hashfunc()
    (compfunc, decompfunc) = get_compfunc()

    # Detect if server side is needed  42944186880
    if args[0] == 'server':
        dstpath = args[1]
        server(dstpath)
    else:
        srcpath = args[0]
        dsthost = args[1]
        if len(args) > 2:
            dstpath = args[2]
        else:
            dstpath = srcpath
        sync(srcpath, dsthost, dstpath)
